using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DataAccessLayer;

public partial class SearchResults : System.Web.UI.Page
{
    Common c = new Common();

    protected void Page_Load(object sender, EventArgs e)
    {
        string conn = c.fetchConnString();
        string cat = Session["category"].ToString();
        string key = Session["keyword"].ToString();

        Search src = new Search(conn);
        switch (cat)
        {
            case "0": // search by disease
                //Search src = new Search(conn);
                src.CATEGORY = cat;
                src.KEYWORD = key;
                grdvwResults.DataSource = src.details();
                grdvwResults.DataBind();
                break;

            case "1": // search by medicine
                //Search src = new Search(conn);
                src.CATEGORY = cat;
                src.KEYWORD = key;
                grdvwResults.DataSource = src.medicineDetails();
                grdvwResults.DataBind();
                break;

            case "2": // search by medical specialist
                //Search src = new Search(conn);
                src.CATEGORY = cat;
                src.KEYWORD = key;
                grdvwResults.DataSource = src.doctorDetails();
                grdvwResults.DataBind();
                break;

            case "3": // search by symptoms
                //Search src = new Search(conn);
                src.CATEGORY = cat;
                src.KEYWORD = key;
                grdvwResults.DataSource = src.symptomsDetails();
                grdvwResults.DataBind();
                break;
        }

        /*if (cat == "0") // search by disease
        {
            Search src = new Search(conn);
            src.CATEGORY = cat;
            src.KEYWORD = key;
            grdvwResults.DataSource = src.details();
            grdvwResults.DataBind();
        }
        if (cat == "1") // search by medicine
        {
            Search src = new Search(conn);
            src.CATEGORY = cat;
            src.KEYWORD = key;
            grdvwResults.DataSource = src.medicineDetails();
            grdvwResults.DataBind();
        }
        if (cat == "2") // search by medical specialist
        {
            Search src = new Search(conn);
            src.CATEGORY = cat;
            src.KEYWORD = key;
            grdvwResults.DataSource = src.doctorDetails();
            grdvwResults.DataBind();
        }
        if (cat == "3") // search by symptoms
        {
            Search src = new Search(conn);
            src.CATEGORY = cat;
            src.KEYWORD = key;
            grdvwResults.DataSource = src.symptomsDetails();
            grdvwResults.DataBind();
        }*/
    }
}
